# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=pebble
pkgver=2.6.0
pkgrel=1
pkgdesc="small RFC 8555 ACME test server not for a production certificate authority"
url="https://github.com/letsencrypt/pebble"
arch="all"
license="MPL-2.0"
options="!check net" # no testsuite, needs to download dependencies
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/letsencrypt/pebble/archive/refs/tags/v$pkgver.tar.gz
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	default_prepare

	go mod download
}

build() {
	go build ./cmd/pebble
	go build ./cmd/pebble-challtestsrv
}

package() {
	install -Dm755 \
		pebble \
		pebble-challtestsrv \
		-t "$pkgdir"/usr/bin
}

sha512sums="
21dfacc33a14087999009fda7b41e013c9da93d71fcfd10e6ccbf075e8887610138344da8058df848a8736c9e66035e5173a8326bbf07edd77dd798fa777ea8e  pebble-2.6.0.tar.gz
"
